Semantic Tag
Decoration mode “decorates” each tag based on certain
arbitrary features of that tag. Decorations are specified using
the variable semantic-decoration-styles.
Toggle Semantic Tag Decoration mode in all Semantic-enabled buffers. With an optional argument arg, enable if arg is positive, and disable otherwise.
The value of this variable is a list of decoration styles for Semantic Tag Decoration mode. Each element in this list should have the form
(name.flag), where name is a style name (a symbol) and flag is non-nilif the style is enabled.The following styles are available:
semantic-tag-boundary- Place an overline in front of each long tag (excluding prototypes).
semantic-decoration-on-private-members- Highlight class members that are designated as private.
semantic-decoration-on-protected-members- Highlight class members that are designated as protected.
semantic-decoration-on-includes- Highlight class members that are includes. Clicking on the highlighted include statements opens a context menu for configuring Semantic includes.
To enable or disable specific decorations, use this function:
Prompt for a decoration style, name, and turn it on or off. With prefix argument arg, turn on if positive, otherwise off. Return non-
nilif the decoration style is enabled.
Face for long tags in the
semantic-tag-boundarydecoration style.
Face for privately-scoped tags in the
semantic-decoration-on-private-membersdecoration style.
Face for protected tags in the
semantic-decoration-on-protected-membersdecoration style.
Face for includes that are not in some other state, in the
semantic-decoration-on-includesdecoration style.
Face for includes that cannot be found, in the
semantic-decoration-on-includesdecoration style.
Face for includes that have not yet been parsed, in the
semantic-decoration-on-includesdecoration style.
You can create new types of decorations using the following function:
Define a new decoration style with name. doc is a documentation string describing the decoration style name. It is appended to auto-generated doc strings. An Optional list of flags can also be specified. Flags are:
:enabled<value> - specify the default enabled value for name.This defines two new overload functions respectively called
NAME-pandNAME-highlight, for which you must provide a default implementation in respectively the functionsNAME-p-defaultandNAME-highlight-default. Those functions are passed a tag.NAME-pmust return non-nilto indicate that the tag should be decorated byNAME-highlight.To put primary decorations on a tag
NAME-highlight, use functions like semantic-set-tag-face, semantic-set-tag-intangible, etc., found in the semantic-decorate library.To add other kind of decorations on a tag,
NAME-highlightmust use semantic-decorate-tag, and other functions of the semantic decoration api found in this library.